package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Setter@Getter
public class HotelDetail extends BaseDomain{
    /**
     * 房型名字
     */
    private String name;
    /**
     * 隶属酒店id
     */
    private Hotel hotel;
    /**
     * 每个房型价格
     */
    private Long price;
    /**
     * 房型图片
     */
    private String imgUrl;


    public String getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name", name);
        map.put("imgUrl", imgUrl);
        map.put("price", price);
        if (hotel != null){
            map.put("hotelId",hotel.getId());
        }
        return JSONUtil.toJSONString(map);
    }

}